/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package gui;

import javax.swing.JScrollPane;
import matching.Match;
import matching.xml.MatchingManager;
import ontology.Ontology;
import org.semanticweb.owl.apibinding.OWLManager;
import org.semanticweb.owl.model.OWLOntologyManager;

/**
 *
 * @author livia
 */
public class OntoViewManager {
    private static OntoViewManager instance;    
    private static MatchingManager matMan = MatchingManager.getInstance();
    private OWLOntologyManager owlMan;
    private JScrollPane srcPane;
    private JScrollPane targPane;
    private OntologyTree source;
    private OntologyTree target;
    private Match match;

    private OntoViewManager() {}

    public static OntoViewManager getInstance(){
        if(instance==null){
            instance = new OntoViewManager();
            instance.owlMan = OWLManager.createOWLOntologyManager();
        }
        return  instance;
    }

    public void setAttributes(JScrollPane paneSrc, JScrollPane paneTarg) {
        srcPane = paneSrc;
        targPane = paneTarg;
    }

    public void loadSource(Ontology src){
        source = new OntologyTree(src);
        source.tripleViewer = MatchingViewManager.getInstance().srcView;
        srcPane.setViewportView(source.getTree());
    }

    public void loadTarget(Ontology targ){
        target = new OntologyTree(targ);
        target.tripleViewer = MatchingViewManager.getInstance().tgtView;
        targPane.setViewportView(target.getTree());
    }
}
